package cn.zf.spring5.service;

import cn.zf.spring5.dao.UserDao;

public class UserService {
    //用spring把userDao注入到UserService中
    //创建UserDao的属性，生成set方法
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void add(){
        System.out.println("service add 方法执行");
        /*//原始方式
        UserDao userDao = new UserDaoImpl();
        userDao.update();
        */
        userDao.update();
    }
}
